#include "select.h"
#include "../print/print.h"
#include <cstdlib>
#include <iostream>

p_r_s selection_by_machine() {
    std::cout << "Machine is selecting: ";
    int select = rand() % 5;
    p_r_s machine_choice;
    switch (select)
    {
    case 0:
        machine_choice = rock; 
        std::cout << "1, ";
        break;
    case 1:
        machine_choice = scissor;
        std::cout << "2, ";
        break;
    case 2:
        machine_choice = water;
        std::cout << "3, ";
        break;
    case 3:
        machine_choice = fire;
        std::cout << "4, ";
        break;
    case 4:
        machine_choice = paper;
        std::cout << "5, ";
        break;
    default:
        break;
    }

    return machine_choice;
}

p_r_s selection_by_player() {
    int select;
    p_r_s player_choice;

    std::cin >> select;
    switch (select)
    {
        case 1:
            player_choice = rock;
            break;
        case 2:
            player_choice = scissor;
            break;
        case 3:
            player_choice = water;
            break;
        case 4:
            player_choice = fire;
            break;
        case 5:
            player_choice = paper;
            break;
        case 6:
            player_choice = help;
            break;
        case 7:
            player_choice = game;
            break;
        case 0:
            player_choice = quit;
            break;
        default:
            player_choice = help;
            break;
    }

    return player_choice;
}